//
//  InfoViewController.m
//  UGuideUS
//
//  Created by Will Wang on 23/07/2012.
//  Copyright (c) 2012 UGuideUs. All rights reserved.
//

#import "InfoViewController.h"
#import "InfoWebViewController.h"

@interface InfoViewController ()

@end

@implementation InfoViewController
@synthesize link;

NSString *linkName;

/*  NAME:       prepareForSegue()
 *
 *  PURPOSE:    Allows another view to prepare for the sending of information from this view.
 */

- (void)prepareForSegue : (UIStoryboardSegue *)segue sender : (id)sender
{
    if ([segue.identifier isEqualToString : @"infoWebView"]) 
    { 
        [segue.destinationViewController setLinkInfo:linkName];
    }
}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:172.0/255   
                                                                        green:04.0/255   
                                                                         blue:08.0/255   
                                                                        alpha:1];
}

- (void)viewDidUnload
{

    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (IBAction)GoToGoogleLink:(id)sender {
    linkName=@"Google";
    [self performSegueWithIdentifier:@"infoWebView" sender:self];
}

- (IBAction)GoToYoutubeLink:(id)sender {
    linkName=@"Youtube";
    [self performSegueWithIdentifier:@"infoWebView" sender:self];
}
@end
